home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 2 / CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso / magazine / amiga_e / amigae.sept.archive / 000052_crash!unx.sas.com!jamie_Wed, 22 Sep 93 04:06:10 PST.msg < prev    next >
Text File  |  1993-11-02  |  2KB  |  51 lines

  1. Received: by bkhouse.cts.com (V1.16/Amiga)
  2.     id AA00000; Wed, 22 Sep 93 04:06:10 PST
  3. Received: from lamb.sas.com by crash.cts.com with smtp
  4.     (Smail3.1.28.1 #18) id m0of8CP-00006ZC; Tue, 21 Sep 93 06:56 PDT
  5. Received: from mozart by lamb.sas.com (5.65c/SAS/Gateway/10-28-91)
  6.     id AA16196; Tue, 21 Sep 1993 09:56:07 -0400
  7. Received: from cdevil.unx.sas.com by mozart (5.65c/SAS/Domains/5-6-90)
  8.     id AA28835; Tue, 21 Sep 1993 09:55:06 -0400
  9. Received: by cdevil.unx.sas.com (5.65c/SAS/Generic 9.01/3-26-93)
  10.     id AA22231; Tue, 21 Sep 1993 09:55:01 -0400
  11. Message-Id: <199309211355.AA22231@cdevil.unx.sas.com>
  12. Date: Tue, 21 Sep 1993 09:55:01 -0500 (EDT)
  13. X-Mailer: ELM [version 2.4 PL20]
  14. Mime-Version: 1.0
  15. Content-Type: text/plain; charset=US-ASCII
  16. Content-Transfer-Encoding: 7bit
  17. Content-Length: 1157
  18. From: James Cooper <jamie@unx.sas.com>
  19. To: amigae@bkhouse.cts.com (Amiga E Mailing List)
  20. Subject: Re: Fixed text strings
  21.  
  22. > I'm trying to figure out how to write a fortune type of program,
  23. > that has (for the first version anyway) 16 or so fixed sayings built
  24. > in to the exe (no extrnal textfiles this time around).  What's the
  25. > most efficient and robust way?
  26. > I thought that for so few items that I should use
  27. > SELECT randomnumber
  28. >   CASE randomnumber=1
  29. >     TextF("First fortune")
  30. >   CASE randomnumber=2
  31. >     TextF("Second fortune")
  32. > etc.
  33. >
  34. > or would it be more memory efficient/faster to toy around with
  35. > pointers?  And have the texts as dc.b's (or the e equivalent thereof)
  36.  
  37. Actually, here's a spot where E really shines...
  38.  
  39. You need to use an E specific feature, called 'Lists'.  This will be the
  40. best way to do what you want to do, and doesn't require any kludges.
  41.  
  42. For instance:
  43.  
  44.   TextF(ListItem(['First fortune','Second fortune'],randomnumber))
  45.  
  46. Just fill in the square brackets with the fortunes you want to use, and
  47. that single E statement does the equivalent of the SELECT statement you
  48. started to use...  :-)
  49.  
  50. (Oh, yeah... remember that E likes single quotes around strings, double
  51. quotes around characters.  Backwards from most other languages, but...)